/**
 */
package wcomm_v1.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import wcomm_v1.DelegationLink;
import wcomm_v1.EndPoint;
import wcomm_v1.Wcomm_v1Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Delegation Link</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link wcomm_v1.impl.DelegationLinkImpl#getEndA <em>End A</em>}</li>
 *   <li>{@link wcomm_v1.impl.DelegationLinkImpl#getEndB <em>End B</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DelegationLinkImpl extends EObjectImpl implements DelegationLink
{
  /**
   * The cached value of the '{@link #getEndA() <em>End A</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEndA()
   * @generated
   * @ordered
   */
  protected EndPoint endA;

  /**
   * The cached value of the '{@link #getEndB() <em>End B</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEndB()
   * @generated
   * @ordered
   */
  protected EndPoint endB;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected DelegationLinkImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return Wcomm_v1Package.Literals.DELEGATION_LINK;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EndPoint getEndA()
  {
    if (endA != null && endA.eIsProxy())
    {
      InternalEObject oldEndA = (InternalEObject)endA;
      endA = (EndPoint)eResolveProxy(oldEndA);
      if (endA != oldEndA)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, Wcomm_v1Package.DELEGATION_LINK__END_A, oldEndA, endA));
      }
    }
    return endA;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EndPoint basicGetEndA()
  {
    return endA;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEndA(EndPoint newEndA)
  {
    EndPoint oldEndA = endA;
    endA = newEndA;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Wcomm_v1Package.DELEGATION_LINK__END_A, oldEndA, endA));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EndPoint getEndB()
  {
    if (endB != null && endB.eIsProxy())
    {
      InternalEObject oldEndB = (InternalEObject)endB;
      endB = (EndPoint)eResolveProxy(oldEndB);
      if (endB != oldEndB)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, Wcomm_v1Package.DELEGATION_LINK__END_B, oldEndB, endB));
      }
    }
    return endB;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EndPoint basicGetEndB()
  {
    return endB;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEndB(EndPoint newEndB)
  {
    EndPoint oldEndB = endB;
    endB = newEndB;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Wcomm_v1Package.DELEGATION_LINK__END_B, oldEndB, endB));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.DELEGATION_LINK__END_A:
        if (resolve) return getEndA();
        return basicGetEndA();
      case Wcomm_v1Package.DELEGATION_LINK__END_B:
        if (resolve) return getEndB();
        return basicGetEndB();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.DELEGATION_LINK__END_A:
        setEndA((EndPoint)newValue);
        return;
      case Wcomm_v1Package.DELEGATION_LINK__END_B:
        setEndB((EndPoint)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.DELEGATION_LINK__END_A:
        setEndA((EndPoint)null);
        return;
      case Wcomm_v1Package.DELEGATION_LINK__END_B:
        setEndB((EndPoint)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.DELEGATION_LINK__END_A:
        return endA != null;
      case Wcomm_v1Package.DELEGATION_LINK__END_B:
        return endB != null;
    }
    return super.eIsSet(featureID);
  }

} //DelegationLinkImpl
